package com.wl4837;

public class App
{
    public static void main( String[] args )
    {
        ChatMediator mediator = new ChatMediatorImpl();

        User user1 = new UserImpl(mediator, "张三");
        User user2 = new UserImpl(mediator, "李四");
        User user3 = new UserImpl(mediator, "王五");
        User user4 = new UserImpl(mediator, "赵六");

        mediator.addUser(user1);
        mediator.addUser(user2);
        mediator.addUser(user3);
        mediator.addUser(user4);

        user1.send("大家好！");
        System.out.println();
        user3.send("你们好！");
    }
}
